package se.liu.johfa428.game.objects.levelselection;

import se.liu.johfa428.levelstate.LevelState;
import se.liu.johfa428.levelstate.LevelState.State;
import se.liu.oschi129.world.model.World;
import se.liu.oschi129.world.objects.WorldStaticObject;
/**
 * This is an invisible block which blocks the path in the level selection world.
 * 
 * @author johfa428
 *
 */
public class ObjectLevelSelectionInvisibleBlock extends WorldStaticObject{
	private LevelState levelState;
	
	public ObjectLevelSelectionInvisibleBlock(double x, double y) {
		this(x,y,null);
	}

	public ObjectLevelSelectionInvisibleBlock(double x, double y, LevelState levelState) {
		super(Type.SOLID, null, false, x, y, 27,23);
		this.levelState = levelState;
	}

	@Override public void performStepAction(World world) {
		if (levelState != null)
			if (levelState.getState() == State.NORMAL)
				setType(Type.SOLID);
			else
				setType(Type.SOFT);
	}
}
